# 在控制台输入n个数字，然后输入end结束，并将输入的数字进行排序并输出
def income_sort():
    try:
        list = []
        while True:
            num = input("请输入数字(输入end结束):")
            if num == 'end':
                break
            if num.isalnum():
                list.append(int(num))
        list.sort()
        print("排序后结果为：",list)
    except Exception as e:
        print('程序运行报错，抛出异常：',e)
if __name__ == '__main__':
    income_sort()